All Questions
26 questions
1vote
1answer
259views
What does " command do in terminal? [duplicate]
Recently, I opened terminal and started typing everything i can, after which i accidentally put " and something like python shell was initialised: muhammadrasul@AMR:~/Desktop$ lksdflaflakd;kfa;lk&...
0votes
1answer
114views
Make shell interpret operators enclosed in single-quotes [closed]
I have two commands built using the logical operator &&. The two commands are enclosed in single-quotes because they are to be passed as a command to root: $ su -c 'sed -i '1i TEXT' file1.txt ...
6votes
4answers
7kviews
How to prevent command substitution on the command line?
I find that when writing text as input to another program, any command substitutions in double quotes within the intended text are interpreted and expanded by the shell The links in the answer here ...
0votes
2answers
2kviews
Run ssh command without quotes
You can execute a command on a remote server using ssh user@host 'the command' but is there a way to execute the command without quotes? (I am on BSD and using OpenSSH)
5votes
3answers
10kviews
How to delete or access a file with a backslash \ in its name?
I have some files here that I copied over to this linux box using the python module pysftp: [jm@spartan tf]$ ls -la total 0 drwxrwxrwx. 3 jm jm 69 Aug 14 13:50 . drwxrwxrwt. 9 root root 238 ...
3votes
2answers
2kviews
Are the single quotes and the double quotes handled by "bash" or by "echo"?
When you do something like this: echo 'Hello World' Or like this: x=12345 echo "x is: $x" In the first example, does the echo command receive 'Hello World', or does it receive Hello World? And in ...
2votes
1answer
2kviews
Quoting a path that contains spaces, in FreeBSD - why doesn't it always work?
I have a directory on my FreeBSD server whose contents are created by Windows users over Samba. The filenames and paths within it sometimes contain spaces, as is common in the Windows world. I just ...
18votes
1answer
46kviews
Printing epoch time with the date utility
From reading another answer I know the following command can be used to print the current epoch time: $ date +'%s' 1491150773 From reading through the date(1) man page (note: I actually use macOS) I ...
5votes
4answers
10kviews
Backslash usage in different commands
I have been trying to get a better understanding of how backslash is used in certain commands. I understand its usage for escaping special characters (Such as echo 'that'\''s no moon' ), but the ...
1vote
1answer
210views
Tab character in exiftool
I need to insert tab character on place of _ between day and hour. exiftool -T -r -filename -CreateDate -d "%Y%"."%m%"."%d_%H%"."%M%"."%S" /Users/***/***/testmapa/mapa2/ > /Users/***/***/testmapa/...
7votes
3answers
6kviews
How to alias a command containing both apostrophes and quotation marks?
As a result of my previous question I decided to alias groe= ?vim -c 'normal "+p1Gdddd"' -c ':%s/\n/' -c 'normal"gVGgJy"' -c'q!'? I cant find out how to substitute '?s' in my example to make it ...
0votes
2answers
3kviews
Bash syntax error when `cd`ing into directory
**So, after doing a little digging, I got it to work. You do get far enough in the install using WINE for this to work properly. Here are the steps: Open the shell, and type in cd .wine cd ...
1vote
2answers
10kviews
Remove file with pound signs around it [duplicate]
I am using SSH to another terminal with very limited disk space. upon typing ls I see a file called #korpus.txt#. I suspect this file is an emacs buffer, but upon running emacs and trying to kill it ...
2votes
2answers
1kviews
What other special characters are there?
For filenames, I know that you have to use either a double quotes or a backslash to include a space in your file name. Like mkdir "I like coffee" is the same as mkdir I\ like\ coffee Now when you ...
1vote
2answers
330views
How can I properly escape a string to be passed to a shell with a command argument [duplicate]
How can I properly escape arbitrary commands? For example: sudo -u chris sh -c 'echo "\"leftright\""' The above echos: "leftright" How would I echo out: "left'right" I've tried the following ...